-E- DXL: pragma (perm) expects an int argument

Any clues why an int variable fails but a raw integer works?

I figured I'd be safer doing multiples of the default so I would not add too many zeros by accident. Why doesn't it work?

int DEFAULT_RUN_LIMIT = 1000000;
int myRunLimit = DEFAULT_RUN_LIMIT * 32;
 
pragma(runLim, myRunLimit       ); // -E- DXL: pragma (perm) expects an int argument
pragma(runLim, (int myRunLimit) ); // -E- DXL: pragma (perm) expects an int argument
pragma(runLim, (int 32000000)   ); // -E- DXL: pragma (perm) expects an int argument
pragma(runLim, 32000000         ); //works
 
ack "What is wrong here?"

SystemAdmin - Fri Sep 02 20:00:24 EDT 2011

Re: -E- DXL: pragma (perm) expects an int argument
OurGuest - Sun Sep 04 18:55:31 EDT 2011

Here is whats wrong, in case 1, 2 and 3 your trying to do something that DOORS won't permit you to do.

In case 4 you supplied a integer instead of a variable which DOORS doesn't permit.

Re: -E- DXL: pragma (perm) expects an int argument
Mathias Mamsch - Mon Sep 05 08:51:01 EDT 2011

I could be wrong, but I think the pragma statement (like the include statement) in DXL is a statement for the DXL Parser and is not executed from the interpreter. The reason why your pragmas fail is that the DXL parser will not do any processing of the statement not even a type cast. I am pretty sure that if you put pragma stack twice, that the second pragma will override the first one, before the program even started.

Note that autodeclare and encoding pragmas are also executed, when the DXL is interpreted. For those however the position matters, since their values affect the interpretation itself.

Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: -E- DXL: pragma (perm) expects an int argument
SystemAdmin - Tue Sep 06 10:31:47 EDT 2011

Mathias Mamsch - Mon Sep 05 08:51:01 EDT 2011
I could be wrong, but I think the pragma statement (like the include statement) in DXL is a statement for the DXL Parser and is not executed from the interpreter. The reason why your pragmas fail is that the DXL parser will not do any processing of the statement not even a type cast. I am pretty sure that if you put pragma stack twice, that the second pragma will override the first one, before the program even started.

Note that autodeclare and encoding pragmas are also executed, when the DXL is interpreted. For those however the position matters, since their values affect the interpretation itself.

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Although I find the DOORS error message misleading, the can't use a variable notion makes sense. You would not be able to use a variable in "C" pre-processor statements either.

Re: -E- DXL: pragma (perm) expects an int argument
Mathias Mamsch - Tue Sep 06 15:23:39 EDT 2011

SystemAdmin - Tue Sep 06 10:31:47 EDT 2011
Although I find the DOORS error message misleading, the can't use a variable notion makes sense. You would not be able to use a variable in "C" pre-processor statements either.

"pragma perm" is actually a different pragma statement. I think this might be a copy paste error ;-) Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: -E- DXL: pragma (perm) expects an int argument
llandale - Tue Sep 06 17:54:54 EDT 2011

As OurGuest said you are doing something wrong. As Mathias said the pragma's are processed before the code is executed. So the parser tries to resolve "pragma(runLim, myRunLimit" before "int DEFAULT_RUN_LIMIT = 1000000" is executed, and it doesn't not understand it. The 2nd argument must be an integer constant ..err.. must look like one, you cannot even do this: 2048*10.

I don't know 'why' these pragmas are processed before the code is interpreted and executed, and I don't know if they 'should' be.

  • Louie

Analogy: My street address is "1172 TalkTooMuch Ally" and the post office will not understand "293*4 TalkTooMuch Ally".